package com.huifer.wgx.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Collection;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * <p>Title : VerifyEntity </p>
 * <p>Description : </p>
 *
 * @author huifer
 * @date 2019-03-20
 */
@Entity
@Table(name = "t_verify", schema = "at15", catalog = "")
public class VerifyEntity {

    private Long verifyId;
    private String verifyName;
    private String verifyType;
    private Collection<DetectionLineEntity> tDetectionLinesByVerifyId;
    private Collection<DetectionPointEntity> tDetectionPointsByVerifyId;

    @Id
    @Column(name = "verify_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getVerifyId() {
        return verifyId;
    }

    public void setVerifyId(Long verifyId) {
        this.verifyId = verifyId;
    }

    @Basic
    @Column(name = "verify_name")
    public String getVerifyName() {
        return verifyName;
    }

    public void setVerifyName(String verifyName) {
        this.verifyName = verifyName;
    }

    @Basic
    @Column(name = "verify_type")
    public String getVerifyType() {
        return verifyType;
    }

    public void setVerifyType(String verifyType) {
        this.verifyType = verifyType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        VerifyEntity that = (VerifyEntity) o;
        return Objects.equals(verifyId, that.verifyId) &&
                Objects.equals(verifyName, that.verifyName) &&
                Objects.equals(verifyType, that.verifyType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(verifyId, verifyName, verifyType);
    }

    @OneToMany(mappedBy = "tVerifyByVerifyId")
    @JsonIgnore
    public Collection<DetectionLineEntity> gettDetectionLinesByVerifyId() {
        return tDetectionLinesByVerifyId;
    }

    public void settDetectionLinesByVerifyId(
            Collection<DetectionLineEntity> tDetectionLinesByVerifyId) {
        this.tDetectionLinesByVerifyId = tDetectionLinesByVerifyId;
    }

    @OneToMany(mappedBy = "tVerifyByVerifyId")
    @JsonIgnore
    public Collection<DetectionPointEntity> gettDetectionPointsByVerifyId() {
        return tDetectionPointsByVerifyId;
    }

    public void settDetectionPointsByVerifyId(
            Collection<DetectionPointEntity> tDetectionPointsByVerifyId) {
        this.tDetectionPointsByVerifyId = tDetectionPointsByVerifyId;
    }
}
